<template>
    <div>
        <div id="billPrint">
            <div>票据打印</div>
        </div>
        <div id="prescriptionPrint">处方打印</div>
        <div id="casePrint">病例打印</div>
        <iframe id="myframe">

        </iframe>
    </div>
</template>
<script>

//import printHtml from "../../../utils/print"
export default {
    name: 'print',
    data () {
        return {

        }
    },
   methods: {
       way(data){
           console.log(data);
           return
            let print = document.getElementsByClassName("myframe")[0]  //获取目标区域
                    let iframe = document.getElementById("myframe").contentWindow
                    let doc = iframe.document
                    doc.write(print.innerHTML)  //将目标区域的html写入iframe
                    iframe.focus()
                    iframe.print()  //打印iframe
       },
   },
    mounted () {
        // printHtml(printData)
    },
}
</script>
